﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SendEmail.aspx.cs" Inherits="GPCSC.Web.WBWZ.SendEmail" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title>发送邮件</title>
<meta name="KEYWords" content="淮安市领导干部下基层活动,三解三促,三进三帮" />
<meta name="DEscription" content="淮安市领导干部下基层活动,三解三促,三进三帮" />
  <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script>  
  <script type="text/javascript" src="../Scripts/validator/jquery.validate.min.js"></script>
  <script type="text/javascript" src="../Scripts/validator/messages_cn.js"></script>
 <link type="text/css" href="../Css/tableCss.css" rel="Stylesheet" />
  <link type="text/css" rel="Stylesheet" href="../Css/textareaCss.css" />
     <script type="text/javascript" src="../scripts/textarearesizer/jquery-latest.js"></script>
    <script type="text/javascript" src="../scripts/textarearesizer/jquery.textarearesizer.compressed.js"></script>
     <link href="../Css/main.css" rel="stylesheet" type="text/css" />
  <script>
      $(document).ready(
      function () {
          //          $("#form1").validate();
          $("td").addClass("td");

          $('textarea.resizable:not(.processed)').TextAreaResizer();
      }
      );

      function SendEMail() {

          var jMail = new ActiveXObject("Jmail.message");


          jMail.Silent = true;


          jMail.Charset = "utf-8";


          jMail.FromName = $("#Text3").val(); //发件人

          jMail.From = $("#Text1").val(); //发送人的邮件地址

          jMail.AddRecipient($("#sjaddress").val()); //收件人的邮件地址

          jMail.Subject = $("#sjzhuti").val();


          jMail.Body = $("#sjnr").val() + "\n" + "发件人邮箱地址为：" + $("#fjaddress").val() + "\n"; //Email 内容

          jMail.MailServerUserName = $("#Text1").val(); //username

          jMail.MailServerPassWord = $("#Text2").val(); //password 

          var ret = jMail.Send("smtp.163.com");

          if (ret == false) {

              alert("发送失败");

          } else {

              alert("发送成功");

          }

          jMail.Close();


      } 

  </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table class="table">
    <tr  style=" display:none">
    <td class="td"  style=" width:30%; text-align:right" >
    收件人邮箱地址：
    </td>
    <td class="td">
    <input type="text" id="sjaddress" runat="server" value="hasjsb@126.com" class="required email" />
    </td>
    </tr>
        
        <tr  style=" display:none">
    
    
    <td class="td"  style=" width:30%; text-align:right" >
    发件人邮箱地址：
    </td>
    <td class="td">
    <input type="text" id="Text1" runat="server" value="mayawei890102@163.com" class="required email" />
    </td>
    </tr>
    <tr  style=" display:none">
    <td class="td"  style=" width:30%; text-align:right" >
   发件人密码邮箱：
    </td>
    <td class="td">
    <input type="text" id="Text2" runat="server" value="wwyawei" class="required email" />
    </td>
    </tr>
    <tr  style=" display:none">
    <td class="td"  style=" width:30%; text-align:right" >
   发件人用户名：
    </td>
    <td class="td">
    <input type="text" id="Text3" runat="server" value="mayawei890102" class="required email" />
    </td>
    </tr>
    <tr>
    <td style=" width:30%; text-align:right">
    邮件主题：
    </td>
    <td>
    <input type="text" id="sjzhuti" runat="server" />
    </td>
    </tr>
    <tr>
    <td style=" width:30%; text-align:right">
    邮件内容：
    </td>
    <td>
    <textarea cols="20"  style=" width:400px;" rows="3"  class="resizable" id="sjnr" runat="server">
    
    </textarea>
    </td>
    </tr>
    <tr>
    <td style=" width:30%; text-align:right">我的邮箱地址：</td>
    <td>
    <input type="text"   id="fjaddress" runat="server" class="email"/>
    </td>
    </tr>
    
    <tr>
    <td colspan="2" style=" text-align:center">
       <%-- <asp:Button ID="Button1" runat="server" Text="发送" onclick="Button1_Click" />--%>
     <asp:Button ID="Button2" runat="server" Text="发送" onclick="Button2_Click" CssClass="buttonCss" />
     <input type="button"   class="buttonCss" value=" 发送" onclick="SendEMail()" style=" display:none"  />
    </td> 
    </tr>
    </table>
    </div>
    </form>
</body>
</html>
